<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
    <meta name="renderer" content="webkit|ie-comp|ie-stand"/>
    <meta http-equiv="X-UA-Compatible" content="ie=edge"/>
    <title>都市言情_好看的都市言情_2019都市言情排行榜_笔趣阁</title>
    <meta name="keywords" content="都市言情,好看的都市言情,2019都市言情排行榜"/>
    <meta name="description" content="笔趣阁是广大书友最值得收藏的都市言情阅读网，网站收录了当前最好看的都市言情，免费提供高质量的2019都市言情排行榜，是广大都市言情爱好者必备的小说阅读网。"/>
</head>
<body>

<link rel="stylesheet" href="https://cdn.bootcss.com/sweetalert/0.5.0/sweet-alert.css"/>
<link rel="stylesheet" href="css/hhh.css"/>
<script src="https://unpkg.com/axios@0.19.2/dist/axios.min.js"></script><!--axios-->
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script><!--vue插件-->
<div id="chapterNameType">
    <div class="header_wap pc_none">
        <span class="title">笔趣阁</span>
        <a class="user" href="##">
            <svg class="lnr lnr-user">
                <use xlink:href="#lnr-user"></use>
            </svg>
        </a>
    </div>
    <div class="header_top"></div>
    <div class="header">
        <div class="wrap">
            <h1 class="logo"><a href="/">笔趣阁</a></h1>
            <div class="search">
                <form action="/"  id="form" >
                    <input class="text" id="keyWord" name="q" v-model="novelName" type="text"
                           placeholder="可搜书名和作者，请您少字也别输错字。"/>
                    <input type="submit" class="btn" @click="queryNovel" value="搜索"/>
                </form>
            </div>
        </div>
        <div class="nav">
            <ul class="nav">
                <li><a href="/index.html">首页</a></li>
                <li><a href="#" @click="chapterNameType('玄幻小说')">玄幻小说</a></li>
                <li><a href="#" @click="chapterNameType('修真小说')">修真小说</a></li>
                <li><a href="#" @click="chapterNameType('都市小说')">都市小说</a></li>
                <li><a href="#" @click="chapterNameType('穿越小说')">穿越小说</a></li>
                <li><a href="#" @click="chapterNameType('网游小说')">网游小说</a></li>
                <li><a href="#" @click="chapterNameType('科幻小说')">科幻小说</a></li>
                <li><a href="#" @click="chapterNameType('其他小说')">其他小说</a></li>
                <li><a href="/setSearch.html">添加小说</a></li>
            </ul>
        </div>
    </div>
    <div class="wrap class">
        <div class="hot">
            <div class="item" v-for="(item,index) in novel">
                <div class="image">
                    <a :href="'/chapterName.html?novelId='+item.id">
                        <img :src="item.url" :alt="item.novelName"/></a>
                </div>
                <dl>
                    <dt><span><a :href="'/authorsWork.html?name='+item.name">{{item.name}}</a></span><a
                            :href="'/chapterName.html?novelId='+item.id">{{item.novelName}} </a></dt>
                    <dd><a :href="'/chapterName.html?novelId='+item.id" style="color:#555;">{{item.briefIntroduction|
                        ellipsis}}</a>
                    </dd>
                </dl>
            </div>

        </div>
        <div class="loadmore">
            加载中……
        </div>
    </div>

</div>

<script>
    new Vue({
        el: '#chapterNameType',
        filters: {
            ellipsis: function (value) {
                if (!value) return ''
                if (value.length > 30) {
                    return value.slice(0, 30) + '...'
                }
                return value
            }
        },
        data: {
            novel: [],
            novelName: "",
        },
        methods: {
            chapterNameType: function (e) {
                window.location.href = "/chapterNameType.html?type=" + e;
            },
            queryNovel: function () {
                window.location.href = "/searchNovelByName.html?novelName=" + this.novelName
            }
        },
        created: function () {
            var that = this;
            let type = decodeURI(window.location.href.split('?')[1].split('=')[1]);
            let token = window.sessionStorage.getItem('token');
            axios.get("/search/type/" + type, {Headers: {'Authorization': token}}).then(function (res) {
                if (res.data.code) {
                    that.novel = res.data.extend.success
                } else {
                    alert("请您先登录");
                    window.location.href = "/login.html"
                }
            })
        }
    })
</script>
</body>
</html>
